#pragma once

#include "Vao.h"
#include "VBO.h"
#include "ShaderProgram.h"

namespace a2d
{
//------------------------------------------------------------------

	class AV2D_EXPORT Quad
	{
	public:
		bool Create(const glm::vec2 &size);
		void SetDepth(float d);
		void SetSize(const glm::vec2 &size);
		void SetTexRect(const glm::vec4 &rect);
		void Draw(const glm::vec2 &pos);
		void Destroy();

		void SetFlip(bool hor, bool ver);

	private:
		static VAO m_vao;
		static ShaderProgram m_shaders;
		Vbo m_vbo;

		glm::vec4 m_color;
		glm::vec2 m_size;
		glm::vec2 m_pos;
		glm::vec4 m_rect;
		float m_depth = 0.0f;
		float m_scale = 1.0f;

		sint m_uniform_pvw;
		sint m_uniform_size;
		sint m_uniform_color;
		sint m_uniform_depth;
		sint m_uniform_scale;
	};

//------------------------------------------------------------------
} // namespace a2d
